import { createApp } from '../../../js/vue';

createApp({
  data() {
    return {
      list: [],
      id: 0,
      name: 'xxx',
      content: '',
      count: 0,
    };
  },
  methods: {
    add() {
      // console.log(this.content);
      if (this.content === '') {
        alert('内容不能为空');
      } else {
        this.list.push({
          id: this.id++,
          name: this.name,
          content: this.content,
          count: this.count,
          time: new Date().toLocaleDateString().replace(/\//g, '-'),
        });
        this.content = '';
      }
    },
  },
}).mount('#app');
